//
//  HWDailyCheckController.m
//  HWanGame
//
//  Created by 陈道斌 on 2019/9/11.
//  Copyright © 2019 Chendaobin. All rights reserved.
//

#import "HWDailyCheckController.h"
#import "HWQiDaoDateView.h"
#import "HWMobileGameView.h"
#import "HWQianDaoModel.h" // 签到模型
#import "HWIntegralMallViewController.h"


@interface HWDailyCheckController ()<UITableViewDelegate,UITableViewDataSource,HWQiDaoDateViewDelegate>
@property(strong,nonatomic) UITableView *mainaTableVie;
@property(strong,nonatomic) UIView *hederView;
@property(strong,nonatomic) UIImageView *beijinginagview;
@property(strong,nonatomic) UIView *dateView; //签到的日期
//@property(strong,nonatomic)UICollectionView *maincollectionView;
@property(strong,nonatomic) HWQiDaoDateView *qiandaoView;
@property(strong,nonatomic) UILabel *lijiLabel;
@property (strong,nonatomic) UILabel *shengyuLabel;
@property (strong,nonatomic) UILabel *jifenLabel;
@property(strong,nonatomic) NSMutableArray *dataMutaArr;
@property(strong,nonatomic) NSDictionary *dataDic; // 累计签到数量







@end

@implementation HWDailyCheckController


-(UITableView *)mainaTableVie {
    
    if  (_mainaTableVie == nil) {
        
      //  _mainaTableVie = [[UITableView alloc]initWithFrame:CGRectMake(0, -StatusBarHeight, kScreenW, kScreenH+StatusBarHeight-44-TabbarSafeBottomMargin) style:UITableViewStyleGrouped];
        
       // _mainaTableVie = [[UITableView alloc]initWithFrame:CGRectMake(0, -StatusBarHeight, kScreenW, kScreenH) style:UITableViewStyleGrouped];
        
        _mainaTableVie = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH) style:UITableViewStylePlain];
        // _mainaTableVie = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH-44) style:UITableViewStylePlain];
      //  _mainaTableVie.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);
        _mainaTableVie.delegate = self;
        _mainaTableVie.dataSource = self;
        _mainaTableVie.backgroundColor = [UIColor yellowColor];
        _mainaTableVie.separatorStyle = UITableViewCellSeparatorStyleNone;
        _mainaTableVie.backgroundColor = RGB(231, 238, 248);
        
        
        
    }
    
    
    return   _mainaTableVie;
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self setupUI];
    // 添加tabview 头部
    [self addheaderView];
    // 设置返回导航栏
    
    [self navigaView];
    
    // 请求的数据
    // [self.qiandaoView refreshData];
    [self chaxuanqiandao];
    
}


- (void)chaxuanqiandao {


    NSString *uidStr = [NSString stringWithFormat:@"%@",[HWLocallyStoredData getLoginUserID]];
    NSString *tStr = [NSString stringWithFormat:@"%ld",[WMUtil getTimeSp]];
    NSString *signStr = [NSString stringWithFormat:@"%@%@%@",uidStr,tStr,@"fsd213ewdsadqwe2121213edsad"];
    NSString  *signStrMd5  =   [WMUtil md5HexDigest:signStr];
    
    
           DLog(@"MD5 ：%@",signStrMd5);
    
      NSDictionary *parametes = @{
                                            @"ios" : @"1",
                                            @"ct"  : @"app",
                                            @"ac" : @"my_sign",
                                            @"t" : tStr,
                                            @"sign" :signStrMd5,
                                            @"uid" :uidStr
    
                                           };
    
    
    self.dataMutaArr = [[NSMutableArray alloc]init];
    
    [HWWebUtils doGetWithParameters:parametes progress:nil success:^(id response) {
    

       NSString *codeStr =  [NSString stringWithFormat:@"%@",response[@"code"]];
           if ([codeStr intValue] == 1) {
               NSLog(@"%@",response);
               self.dataDic = response[@"my"];
               self.dataMutaArr = [HWQianDaoModel mj_objectArrayWithKeyValuesArray:response[@"top"]];
               self.qiandaoView.dataMuArr =  self.dataMutaArr;
                // 刷新签到数据
               [self.qiandaoView refreshData];
               
               NSString *leijiStr = [NSString stringWithFormat:@"你已累计签到%@天",self.dataDic[@"count"]];
               
               
               
               
               NSString *countstr = [NSString stringWithFormat:@"%@",self.dataDic[@"count"]];
               
               self.lijiLabel.attributedText = [WMUtil attributedStringWithText:leijiStr withRangText:countstr withColor:RGB(255, 134, 6) withFont:[UIFont systemFontOfSize:13]];
               
               
               
               if (self.dataDic[@"serial"] != nil && self.dataDic[@"bu_num"]  != nil) {
                   
                   NSString *lianxuStr = [NSString stringWithFormat:@"连续签到%@天 本月剩余%@次补签",self.dataDic[@"serial"],self.dataDic[@"bu_num"]];
                   NSString *str = [NSString stringWithFormat:@"%@",self.dataDic[@"bu_num"]];
                   //self.dataDic[@"bu_num"];
                    self.shengyuLabel.attributedText = [WMUtil attributedStringWithText:lianxuStr withRangText:str withColor:RGB(255, 134, 6) withFont:[UIFont systemFontOfSize:12]];
                                
                   
               }
             
              NSString *jifenStr = [NSString stringWithFormat:@"我的积分：%@",self.dataDic[@"charge_points"]];
               self.jifenLabel.attributedText = [WMUtil attributedStringWithText:jifenStr withRangText:self.dataDic[@"charge_points"] withColor:RGB(255, 134, 6) withFont:[UIFont systemFontOfSize:12]];
               
               
               
               
               
          
            } else {
    
                [MBProgressHUD showError:response[@"message"]];
    
            }
    
    
    
      } failure:^(NSString *error) {
            // [SVProgressHUD dismiss];
    
                    [MBProgressHUD showSuccess:@"查询失败"];
            //  [MBProgressHUD hideHUD];
    
    
     }];
    

    
    
    
    
}








// 设置UI
- (void)setupUI {
    self.navigationItem.title = @"每日签到";
    self.view.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:self.mainaTableVie];
    
}





- (void)navigaView  {
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(10,StatusBarHeight, 40, 44);
    // button.backgroundColor = [UIColor redColor];
    [button setImage:[UIImage imageNamed:@"details_back"] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(buttonTap) forControlEvents:UIControlEventTouchUpInside];
    
    [self.view addSubview:button];
    
    UILabel *textlabel = [[UILabel alloc]initWithFrame:CGRectMake((kScreenW-70)/2, StatusBarHeight, 70, 44)];
    textlabel.text = @"每日签到";
    textlabel.textAlignment =  NSTextAlignmentCenter;
    textlabel.textColor = [UIColor whiteColor];
    textlabel.font = [UIFont systemFontOfSize:16];
    [self.view addSubview:textlabel];
    

}

//
- (void)buttonTap {
    
    [self.navigationController popViewControllerAnimated:YES];
    
    
}

// 添加tabview
- (void)addheaderView {
    
    UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH-StatusBarHeight)];
    view.backgroundColor = [UIColor redColor];
    view.backgroundColor = RGB(231, 238, 248);
    self.hederView = view;
   // self.mainaTableVie.tableHeaderView = view;
    self.mainaTableVie.tableHeaderView = self.hederView;
    
    
    UIView *beijiview = [[UIView alloc]initWithFrame:CGRectMake(0, -StatusBarHeight, kScreenW, 211*CFLScaleValue+StatusBarHeight)];
    
    beijiview.backgroundColor = [UIColor orangeColor];
    [self.hederView addSubview:beijiview];
    
    
    UIImageView *beijiimageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, -StatusBarHeight, kScreenW, 211*CFLScaleValue+StatusBarHeight)];
    beijiimageView.image = [UIImage imageNamed:@"sign_bg"];
    beijiimageView.userInteractionEnabled = YES;
    
    self.beijinginagview = beijiimageView;
    [self.hederView addSubview:beijiimageView];
    
    // 270  24 14
    UIView *dateView1 = [[UIView alloc]initWithFrame:CGRectMake(0, 18+44+StatusBarHeight, kScreenW, 24*CFLScaleValue+13+8)];
  //  dateView1.backgroundColor = [UIColor yellowColor];
  
    [self.beijinginagview addSubview:dateView1];
    
    self.dateView = dateView1;
    
    UIImageView  *zuibianimage = [[UIImageView alloc]initWithFrame:CGRectMake(28.5*CFLScaleValue, (7*CFLScaleValue+13+8)/2, 9*CFLScaleValue, 17*CFLScaleValue)];
    zuibianimage.image = [UIImage imageNamed:@"zuobian_ico"];
    [dateView1 addSubview:zuibianimage];
    
    UIImageView  *youbianbianimage = [[UIImageView alloc]initWithFrame:CGRectMake(kScreenW-28.5*CFLScaleValue-9*CFLScaleValue, (7*CFLScaleValue+13+8)/2, 9*CFLScaleValue, 17*CFLScaleValue)];
    youbianbianimage.image = [UIImage imageNamed:@"youbiananniu_Ico"];
    [dateView1 addSubview:youbianbianimage];
    
    // 签到日期Uiview
   // [self qinDaoRiQiView];
    [self qinDaoRiQiView];
    
}





// 签到日期
- (void)qinDaoRiQiView {
  //  CGRectMake((28.5+9+15)*CFLScaleValue, 0, kScreenW- (28.5+9+15)*2*CFLScaleValue,200)
   
    
    self.qiandaoView  =[[HWQiDaoDateView alloc]initWithFrame:CGRectMake((28.5+9+15)*CFLScaleValue, 0, kScreenW- (28.5+9+15)*2*CFLScaleValue, 24*CFLScaleValue+13+8)];
    self.qiandaoView.backgroundColor = [UIColor clearColor];
    self.qiandaoView.delegate = self;
    [self.dateView addSubview: self.qiandaoView];
    
    
    UIView *qindaoview = [[UIView alloc]initWithFrame:CGRectMake(28.5*CFLScaleValue,  self.dateView.bottom+25, kScreenW-28.5*CFLScaleValue, 13+9+12)];
  //  qindaoview.backgroundColor = [UIColor redColor];
    [self.beijinginagview addSubview:qindaoview];
    
    
    UIImageView *imagvie = [[UIImageView alloc]initWithFrame:CGRectMake(0, 3, 26, 28)];
    imagvie.image = [UIImage imageNamed:@"QC_sign_icon"];
    [qindaoview addSubview:imagvie];
    
    self.lijiLabel  = [[UILabel alloc]initWithFrame:CGRectMake(10+26,0 , 600, 13)];
    self.lijiLabel.text = @"你已累计签到3天";
    self.lijiLabel.font = [UIFont systemFontOfSize:13];
    self.lijiLabel.textColor = [UIColor whiteColor];
    //   self.mingchenglabel.backgroundColor = [UIColor redColor];
    
    self.lijiLabel.attributedText = [WMUtil attributedStringWithText:@"你已累计签到3天" withRangText:@"3" withColor:RGB(255, 134, 6) withFont:[UIFont systemFontOfSize:13]];
    [qindaoview addSubview: self.lijiLabel];
    
    self.shengyuLabel  = [[UILabel alloc]initWithFrame:CGRectMake(10+26, self.lijiLabel.bottom+9 , 600, 12)];
    self.shengyuLabel.text = @"连续签到0天 本月剩余5次补签";
    self.shengyuLabel.font = [UIFont systemFontOfSize:12];
    

    
    
    self.shengyuLabel.textColor = [UIColor whiteColor];
    self.shengyuLabel.attributedText = [WMUtil attributedStringWithText:@"连续签到0天 本月剩余5次补签" withRangText:@"5" withColor:RGB(255, 134, 6) withFont:[UIFont systemFontOfSize:12]];
    //   self.mingchenglabel.backgroundColor = [UIColor redColor];
    [qindaoview addSubview: self.shengyuLabel];
    
  

    UIView *guizeView1 = [[UIView alloc]initWithFrame:CGRectMake(16*CFLScaleValue, self.beijinginagview.bottom+12, kScreenW-32*CFLScaleValue, 106)];
    guizeView1.layer.cornerRadius = 6;
    guizeView1.layer.masksToBounds = YES;
   // guizeView1.hidden = YES;
    guizeView1.backgroundColor = [UIColor whiteColor];
    
    [self.hederView addSubview:guizeView1];
    
    UILabel *miashulabel = [[UILabel alloc]initWithFrame:CGRectMake(11, 0, kScreenW-32*CFLScaleValue-20, 31)];
    miashulabel.text = @"签到规则";
    miashulabel.font = [UIFont systemFontOfSize:12];
    miashulabel.textColor = RGB(51, 51, 51);
    [guizeView1 addSubview:miashulabel];
  
    UILabel *meiriqianlabe = [[UILabel alloc]initWithFrame:CGRectMake(11, 31, kScreenW-32*CFLScaleValue-22, 24)];
    meiriqianlabe.numberOfLines = 2;
    meiriqianlabe.text =  @"每日签到获得1积分，连续签到每日+1积分，普通用户单日最高上限5积分，会员用户单日最高上限10积分.会员用户每月有5次补签机会哦！";
    meiriqianlabe.font = [UIFont systemFontOfSize:10];
    meiriqianlabe.textColor = RGB(51, 51, 51);
    [guizeView1 addSubview:meiriqianlabe];
    
    UIView *xianView = [[UIView alloc]initWithFrame:CGRectMake(0, 106-41,  kScreenW-32*CFLScaleValue, 1)];
    xianView.backgroundColor = RGB(215, 215, 215);
    
    [guizeView1 addSubview:xianView];
    
    UIButton *butt = [UIButton buttonWithType:UIButtonTypeCustom];
    butt.frame = CGRectMake(kScreenW-32*CFLScaleValue-85-4,  106-40+8, 85, 24);
    butt.backgroundColor = RGB(243, 243, 243);
    [butt setTitle:@"积分商城" forState:UIControlStateNormal];
    [butt setTitleColor:RGB(31, 130, 255) forState:UIControlStateNormal];
    butt.layer.cornerRadius = 12;
    butt.layer.masksToBounds = YES;
    butt.titleLabel.font = [UIFont systemFontOfSize:11];
    [butt  addTarget:self action:@selector(shanchengTap) forControlEvents:UIControlEventTouchUpInside];
    
    [guizeView1 addSubview:butt];
    
    UILabel *numberlabel = [[UILabel alloc]initWithFrame:CGRectMake(11, 106-40, 300, 40)];
    numberlabel.text = @"我的积分：1";
      numberlabel.textColor = RGB(51, 51, 51);
    numberlabel.font = [UIFont systemFontOfSize:11];
    numberlabel.attributedText = [WMUtil attributedStringWithText:@"我的积分：1" withRangText:@"1" withColor:RGB(255, 134, 6) withFont:[UIFont systemFontOfSize:12]];
    self.jifenLabel = numberlabel;
    
    
    [guizeView1 addSubview:numberlabel];
    
    
    
    
    UILabel *lijiqinadaoLabel4 =  [[UILabel alloc]initWithFrame:CGRectMake(kScreenW-16*CFLScaleValue-9-44, self.beijinginagview.bottom-10, 44, 44)];
    lijiqinadaoLabel4.numberOfLines = 2;
    lijiqinadaoLabel4.backgroundColor = RGB(38, 153, 255);
    lijiqinadaoLabel4.textAlignment =  NSTextAlignmentCenter;
    lijiqinadaoLabel4.text = @"立即签到";
    lijiqinadaoLabel4.font = [UIFont systemFontOfSize:12];
    lijiqinadaoLabel4.textColor = [UIColor whiteColor];
    lijiqinadaoLabel4.layer.cornerRadius = 22;
    lijiqinadaoLabel4.layer.masksToBounds = YES;
    lijiqinadaoLabel4.userInteractionEnabled = YES;
     UITapGestureRecognizer  *tapqiandao = [[ UITapGestureRecognizer  alloc]initWithTarget:self action:@selector(lijiqinadaoLabeltap)];

    [lijiqinadaoLabel4 addGestureRecognizer:tapqiandao];
    [self.hederView addSubview:lijiqinadaoLabel4];
    
    
    UIImageView *kapinimagevie = [[UIImageView alloc]initWithFrame:CGRectMake(15*CFLScaleValue, guizeView1.bottom+12, kScreenW-15*CFLScaleValue*2, 99*CFLScaleValue)];
    kapinimagevie.userInteractionEnabled = YES;
    
    // 这边隐藏了一个东西
    kapinimagevie.hidden = YES;
    kapinimagevie.image = [UIImage imageNamed:@"sing_vip"];
    [self.hederView addSubview:kapinimagevie];
    
    UIView *buqianviewlabel = [[UIView alloc]initWithFrame:CGRectMake(30, (99*CFLScaleValue-35)/2, 170, 35)];
//  buqianviewlabel.backgroundColor = [UIColor redColor];
    [kapinimagevie addSubview:buqianviewlabel];
    
    UILabel *lbeel1 = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 170, 13)];
    lbeel1.text = @"开通会员每月可享5次补签";
    lbeel1.font = [UIFont systemFontOfSize:13];
    lbeel1.textColor = RGB(255, 255, 255);
    lbeel1.attributedText = [WMUtil attributedStringWithText:@"开通会员每月可享5次补签" withRangText:@"5" withColor:RGB(255, 134, 6) withFont:[UIFont systemFontOfSize:13]];
    
    [buqianviewlabel addSubview:lbeel1];
    
    
    UILabel *lbeel2 = [[UILabel alloc]initWithFrame:CGRectMake(0, 22, 170, 10)];
    lbeel2.text = @"会员专属优惠等你享！";
    lbeel2.font = [UIFont systemFontOfSize:10];
    lbeel2.textColor = RGB(255, 255, 255);
    [buqianviewlabel addSubview:lbeel2];
    
    UIButton *butt4 = [UIButton buttonWithType:UIButtonTypeCustom];
    butt4.frame = CGRectMake(kapinimagevie.width-20-75,   (99*CFLScaleValue-24)/2, 75, 24);
    butt4.backgroundColor = RGB(243, 243, 243);
    [butt4 setTitle:@"立即开通" forState:UIControlStateNormal];
    [butt4 setTitleColor:RGB(22, 135, 255) forState:UIControlStateNormal];
    butt4.layer.cornerRadius = 12;
    butt4.layer.masksToBounds = YES;
    butt4.titleLabel.font = [UIFont systemFontOfSize:13];
    [kapinimagevie addSubview:butt4];
    [butt4 addTarget:self action:@selector(lijikaitong) forControlEvents:UIControlEventTouchUpInside];
    
    
}


- (void)lijikaitong {
    
    
    DLog(@"dojdijooi");
    
}


#pragma mark ----- 点击立即签到按钮
- (void)lijiqinadaoLabeltap {
    
    DLog(@"立即签到");
    
    
    
      NSString *uidStr = [NSString stringWithFormat:@"%@",[HWLocallyStoredData getLoginUserID]];
      NSString *tStr = [NSString stringWithFormat:@"%ld",[WMUtil getTimeSp]];
      NSString *signStr = [NSString stringWithFormat:@"%@%@%@",uidStr,tStr,@"fsd213ewdsadqwe2121213edsad"];
       NSString  *signStrMd5  =   [WMUtil md5HexDigest:signStr];
      
      
             DLog(@"MD5 ：%@",signStrMd5);
      
        NSDictionary *parametes = @{
                                              @"ios" : @"1",
                                              @"ct"  : @"app",
                                              @"ac" : @"sign",
                                              @"t" : tStr,
                                              @"sign" :signStrMd5,
                                              @"uid" :uidStr
      
                                             };
    
    
      
      
      self.dataMutaArr = [[NSMutableArray alloc]init];
      
      
      [MBProgressHUD show:@"正在签到...."];
      [HWWebUtils doGetWithParameters:parametes progress:nil success:^(id response) {
      

         NSString *codeStr =  [NSString stringWithFormat:@"%@",response[@"code"]];
             if ([codeStr intValue] == 1) {
            
                [MBProgressHUD showError:response[@"message"]];
                 [self  chaxuanqiandao];
                 
                 
                 
                 
            
              } else {
      
                  [MBProgressHUD showError:response[@"message"]];
      
              }
      
      
      
        } failure:^(NSString *error) {
              // [SVProgressHUD dismiss];
      
                      [MBProgressHUD showSuccess:@"查询失败"];
              //  [MBProgressHUD hideHUD];
      
      
       }];
    
    
    
    
    
    
}





#pragma mark ------ UITableViewDelegate


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    
     return  0;
}





- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    UITableViewCell *cell =  [[UITableViewCell alloc]init];
    cell.backgroundColor = [UIColor orangeColor];
    return  cell;
    
    
    
    
}


- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    return  44;
    
    
  
    
    
}



//#p   HWQiDaoDateViewDelegate 点击签到按钮

#pragma mark -------   HWQiDaoDateViewDelegate 点击签到按钮
- (void)qindaoData:(HWQianDaoModel *)model {
    
    NSLog(@"签到时间 %@",model.time);
    
    NSString *timeStr = model.time;
  //  NSDate 
    
    
    NSDate *xuanzhongRiQi =  [WMUtil dateFromString:timeStr];
    BOOL  panduan=   [WMUtil compareDate:[NSDate date] withDate:xuanzhongRiQi];
    
    if (panduan) {
        
        NSLog(@"1");
        [MBProgressHUD showError:@"时间还没有到不能签到"];
        
        
    } else {
        // timeStr 时间小
        // NSLog(@"2");
         
       // isDateInToday
   //    [xuanzhongRiQi isEqualToDate:<#(nonnull NSDate *)#>]
        
        BOOL   jingtian =   [WMUtil   checkTheDate:timeStr];
        
        if (jingtian) {
            
            NSLog(@"今天");
            [self lijiqinadaoLabeltap];
            
            
        } else {
            
             NSLog(@"前天");
            
            NSString *ziStr = [timeStr stringByReplacingOccurrencesOfString:@"-" withString:@""];
           //  [self retroactiveqindao];
            NSLog(@"取代哦  %@",ziStr);
            [self retroactiveqindao:ziStr];

        }
        
        
        
    }
  
     
    
    
   
    
    
}


//补签
- (void)retroactiveqindao:(NSString *)time {
    
    
       NSString *uidStr = [NSString stringWithFormat:@"%@",[HWLocallyStoredData getLoginUserID]];
        NSString *tStr = [NSString stringWithFormat:@"%ld",[WMUtil getTimeSp]];
        NSString *signStr = [NSString stringWithFormat:@"%@%@%@",uidStr,tStr,@"fsd213ewdsadqwe2121213edsad"];
        NSString  *signStrMd5  =   [WMUtil md5HexDigest:signStr];
        
        
               DLog(@"MD5 ：%@",signStrMd5);
        
          NSDictionary *parametes = @{
                                                @"ios" : @"1",
                                                @"ct"  : @"app",
                                                @"ac" : @"bu_sign",
                                                @"t" : tStr,
                                                @"sign" :signStrMd5,
                                                @"uid" :uidStr,
                                                @"date" : time
                                                
                                               };
      
      
        
        
        self.dataMutaArr = [[NSMutableArray alloc]init];
        
        
        [MBProgressHUD show:@"正在补签到...."];
        [HWWebUtils doGetWithParameters:parametes progress:nil success:^(id response) {
        

           NSString *codeStr =  [NSString stringWithFormat:@"%@",response[@"code"]];
               if ([codeStr intValue] == 1) {
              
                   [MBProgressHUD showError:response[@"message"]];
                   [self  chaxuanqiandao];
                   
                   
                   
                   
              
                } else {
        
                    [MBProgressHUD showError:response[@"message"]];
        
                }
        
        
        
          } failure:^(NSString *error) {
                // [SVProgressHUD dismiss];
        
                 [MBProgressHUD showSuccess:@"不签失败"];
                //  [MBProgressHUD hideHUD];
        
        
         }];
    
    
    
    
    
    
    
    
}









#pragma mark -------- UICollectionViewDelegate

//- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
//    return 100;
//}
//

//- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
//
//    UICollectionViewCell  *cell =  [collectionView dequeueReusableCellWithReuseIdentifier:@"cellID111" forIndexPath:indexPath];
//    cell.backgroundColor =  RGB(217, 247, 250);
//    return cell;
//
//
//}

//- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
//
//    return CGSizeMake(40,40);
//}
//
//
//
//- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
//
//    DLog(@"点击精品手游单元格");
//}






- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    
    [self.navigationController setNavigationBarHidden:YES animated:animated];
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    
    [self.navigationController setNavigationBarHidden:NO animated:animated];
}

#pragma maek ------- 点击商城按钮

- (void)shanchengTap {
    
    HWIntegralMallViewController *IntegralMall = [[HWIntegralMallViewController alloc]init];
    [self.navigationController pushViewController:IntegralMall animated:YES];
    
}

@end
